package ru.dadle8.service.impl.action.workout;

import org.springframework.stereotype.Service;
import org.telegram.telegrambots.meta.api.objects.Update;
import org.telegram.telegrambots.meta.exceptions.TelegramApiException;
import ru.dadle8.model.bot.entity.State;
import ru.dadle8.model.bot.type.Action;
import ru.dadle8.model.bot.type.CommandState;
import ru.dadle8.service.api.action.ActionService;
import ru.dadle8.service.impl.action.AbstractActionService;

@Service
public class FillWorkoutsStartActionServiceImpl extends AbstractActionService implements ActionService {

    @Override
    public String getAction() {
        return Action.FILL_WORKOUTS.getAction();
    }

    @Override
    public void processUpdate(Update update) throws TelegramApiException {
        getStorage().updateState(new State(4010, CommandState.FILL_WORKOUTS, getChatId()));
        getBot().execute(getMessageHelper().sendMessage(getChatId(), "Начинаем обновлять данные по упражнениям"));
    }
}
